package com.wrx.club_management_backend.controller;

import com.wrx.club_management_backend.common.AjaxResult;
import com.wrx.club_management_backend.dto.MessageUpdateDTO;
import com.wrx.club_management_backend.service.MsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/msg")
public class MsgController {
    @Autowired
    MsgService msgService;

    @GetMapping("/history/{friendId}")
    public AjaxResult history(@PathVariable("friendId") Long friendId){
        return msgService.history(friendId);
    }

    @PostMapping("/update")
    public  AjaxResult update(@RequestBody MessageUpdateDTO dto){
        return msgService.updateStat(dto);
    }
}
